home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_1 / easyprocess / source / launch / killproc.c < prev    next >
C/C++ Source or Header  |  1992-09-07  |  824b  |  46 lines

  1. #include <arpbase.h>
  2. #include <arp_proto.h>
  3. #include "Launch.h"
  4. #include "LaunchPriv.h"
  5.  
  6. /*
  7.  *    NAME
  8.  *        KillProcess -- try to kill a process via a signal.
  9.  *
  10.  *    SYNOPSIS
  11.  *        KillProcess (Proc)
  12.  *
  13.  *        void KillProcess (struct Process *);
  14.  *
  15.  *    DESCRIPTION
  16.  *        Send a KILL_PROCESS_FLAG signal to the process.
  17.  *
  18.  *    INPUT
  19.  *        Proc - the process to be killed.
  20.  *
  21.  *    OUTPUT
  22.  *        None.
  23.  *
  24.  *    NOTE
  25.  *        You DON'T need to be the parent to call this.
  26.  *
  27.  *        This function does not wait to see if the process really dies,
  28.  *        you MUST call WaitProcesses() before quitting !!!
  29.  *
  30.  *    HISTORY
  31.  *        1992/09/06    Pierre Baillargeon        Creation
  32.  *
  33.  *    SEE ALSO
  34.  *        StartProcess(), WaitProcesses(), WaitProcess()
  35.  */
  36.  
  37. void KillProcess (struct Process *Proc)
  38. {
  39.     Forbid ();
  40.     if (IsChild (Proc))
  41.     {
  42.         Signal (Proc, KILL_PROCESS_FLAG);
  43.     }
  44.     Permit ();
  45. }
  46.